<template>
	<div>
		<div class="head-top">
			<mt-header title="系统消息">
				<router-link to="/message" slot="left">
					<mt-button icon="back"></mt-button>
				</router-link>
			</mt-header>
		</div>

		<div class="mian">

			<div class="meg">
				<div class="title" v-text="title"></div>
				<div class="content" v-html="content"></div>
				<p class="time" v-text="publishTime"></p>
			</div>
		</div>
	</div>
</template>

<script>
	import api from './../../../api/api.js'

	export default {
		name: 'sysmsgdetails',
		data() {
			return {
				active: 'organization',
				datevalue: '',
				title:'',
				content:'没有任何内容',
				publishTime:'',
			}
		},
		created() {
			this.datevalue = this.formatDate(new Date().getTime());
			this.getinfoSys();
		},
		methods: {
			getinfoSys() {
				this.$http({
						method: 'post',
						url: api.baseURL + 'queryNoticeList',
						params: {
							inParam: {
								time: this.datevalue,
								sysCode: "FH_PUBOPE",
								accId: "1",
								orgId: "1",
								terminalType: 1,
								callType: 2,
								currentPage: 1,
								pageSize: 10,
							}

						}
					})
					.then(response => {
						console.log(response.data.data)
						let arrAll = response.data.data;
						let ids = this.$route.params.ids;
						for(let i in arrAll) {
							let obj = arrAll[i];
							if(obj.id == ids) {
								this.title =  obj.title;
								this.content = obj.content;	
								this.publishTime =obj.publishTime;
								break;
							}
						}
					})
					.catch(error => {
						console.log(error);
					});
			},
		},

	}
</script>

<style scoped>
	.head-top {
		width: 100%;
		overflow: hidden;
	}
	
	.mian {
		width: 100%;
		box-sizing: border-box;
		overflow: hidden;
		word-wrap: break-word;
		word-break: normal;
	}
	
	.mian .title {
		text-align: center;
		margin-top: 10px;
		margin-bottom: 10px;
		font-size: 18px;
		word-wrap: break-word;
		word-break: normal;
	}
	
	.mian .content>img {
		width: 100px !important;
		display: inline;
	}
	
	.mian .time {
		text-align: right;
		margin-top: 20px;
	}
	/*.mian .meg div {
		width: 100%;
		text-align: center;
		padding: 15px 0;
		font-size: 13px;
		color: #868686;
	}*/
	
	.mian .imgs>img {
		width: 100% !important;
		height: auto;
		max-width: 100%;
		display: block;
	}
</style>